package com.zhixing.user.domain.dto;

import com.zhixing.user.domain.enums.Gender;
import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserDTO {

    /**
     * 用户id
     * @example 1
     */
    @NotNull(message = "用户id不能为空")
    private Integer id;

    /**
     * 头像
     * @example http://...
     */
    private String avatar;

    /**
     * 昵称
     * @example zx_pqwr21a
     */
    @NotBlank(message = "昵称不能为空")
    @Size(max = 30, message = "昵称不能超过30个字符")
    private String nickname;

    /**
     * 性别
     * @example 0
     */
    @NotNull(message = "性别不能为空")
    private Gender gender;

    /**
     * 手机号
     * @example 13312341234
     */
    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    /**
     * 邮箱
     * @example 13312341234@163.com
     */
    @Email(message = "邮箱格式不正确")
    private String email;
}
